<header>
    <div class="nav">

        <div>
            <a href="/article/">V-blog</a>
        </div>
        <% if(!user){ %>
        <div>
            <a href="/user/login">登录</a>
            <a href="/user/reg">注册</a>
        </div>
        <% }else{%>
        <div class="user">
            <% if(user.avatar){ %>
            <img src="/img/<%- user.avatar %>">
            <% } %>
            <a href="#"> <%- user.username%> </a>
            <a href="/article/send">发表文章</a>
            <a href="/user/logout">退出</a>
        </div>
        <% }%>
    </div>
</header>